<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: src/wickrcrypto/include/wickrcrypto/kdf.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_92a70b6cc7e213c660915fdf1190028f.html">wickrcrypto</a></li><li class="navelem"><a class="el" href="dir_db4377ef08cfba82f5e7141624102360.html">include</a></li><li class="navelem"><a class="el" href="dir_2adb4122f2f58e588d09641dee9865e2.html">wickrcrypto</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">kdf.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright © 2012-2018 Wickr Inc.  All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * This code is being released for EDUCATIONAL, ACADEMIC, AND CODE REVIEW PURPOSES</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * ONLY.  COMMERCIAL USE OF THE CODE IS EXPRESSLY PROHIBITED.  For additional details,</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * please see LICENSE</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * THE CODE IS MADE AVAILABLE &quot;AS-IS&quot; AND WITHOUT ANY EXPRESS OR</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * IMPLIED GUARANTEES AS TO FITNESS, MERCHANTABILITY, NON-</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * INFRINGEMENT OR OTHERWISE. IT IS NOT BEING PROVIDED IN TRADE BUT ON</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * A VOLUNTARY BASIS ON BEHALF OF THE AUTHOR’S PART FOR THE BENEFIT</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * OF THE LICENSEE AND IS NOT MADE AVAILABLE FOR CONSUMER USE OR ANY</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * OTHER USE OUTSIDE THE TERMS OF THIS LICENSE. ANYONE ACCESSING THE</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * CODE SHOULD HAVE THE REQUISITE EXPERTISE TO SECURE THEIR SYSTEM</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * AND DEVICES AND TO ACCESS AND USE THE CODE FOR REVIEW PURPOSES</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * ONLY. LICENSEE BEARS THE RISK OF ACCESSING AND USING THE CODE. IN</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * PARTICULAR, AUTHOR BEARS NO LIABILITY FOR ANY INTERFERENCE WITH OR</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * ADVERSE EFFECT THAT MAY OCCUR AS A RESULT OF THE LICENSEE</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * ACCESSING AND/OR USING THE CODE ON LICENSEE’S SYSTEM.</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#ifndef kdf_h</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#define kdf_h</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;buffer.h&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;digest.h&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    </div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="group__wickr__kdf.html#ga106149e3507106abb6b5be843a4e7c16">   47</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> { KDF_BCRYPT, KDF_SCRYPT, KDF_HMAC_SHA2 } <a class="code" href="group__wickr__kdf.html#ga106149e3507106abb6b5be843a4e7c16">wickr_kdf_algo_id</a>;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> { KDF_ID_SCRYPT_17 = 1, KDF_ID_SCRYPT_18, KDF_ID_SCRYPT_19, KDF_ID_SCRYPT_20, KDF_ID_BCRYPT_15, KDF_ID_HKDF_SHA256, KDF_ID_HKDF_SHA384, KDF_ID_HKDF_SHA512 } wickr_kdf_id;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structwickr__kdf__algo.html">   71</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo</a> {</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structwickr__kdf__algo.html#a1bc420e2ca0f36169e261205bf6246e9">   72</a></span>&#160;    <a class="code" href="group__wickr__kdf.html#ga106149e3507106abb6b5be843a4e7c16">wickr_kdf_algo_id</a> <a class="code" href="structwickr__kdf__algo.html#a1bc420e2ca0f36169e261205bf6246e9">algo_id</a>;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="structwickr__kdf__algo.html#a0cf9976901115634ddbb6193b6e326ba">   73</a></span>&#160;    wickr_kdf_id <a class="code" href="structwickr__kdf__algo.html#a0cf9976901115634ddbb6193b6e326ba">kdf_id</a>;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structwickr__kdf__algo.html#a9a6ccf9787e16898d1724292dab6593e">   74</a></span>&#160;    uint8_t <a class="code" href="structwickr__kdf__algo.html#a9a6ccf9787e16898d1724292dab6593e">salt_size</a>;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structwickr__kdf__algo.html#a75e5396b3c53817c6799dbf3107e36d6">   75</a></span>&#160;    uint8_t <a class="code" href="structwickr__kdf__algo.html#a75e5396b3c53817c6799dbf3107e36d6">output_size</a>;</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="structwickr__kdf__algo.html#a3591ba4f7b6b916381ad28327a67d08c">   76</a></span>&#160;    uint32_t <a class="code" href="structwickr__kdf__algo.html#a3591ba4f7b6b916381ad28327a67d08c">cost</a>;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;};</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo</a> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a>;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="group__wickr__kdf.html#ga5e8df13eb2cd5cc1e09f377675ddc50f">   92</a></span>&#160;<span class="preprocessor">#define SCRYPT_2_17_COST 1116161</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor">#define SCRYPT_2_18_COST 1181697</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="preprocessor">#define SCRYPT_2_19_COST 1247233</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="preprocessor">#define SCRYPT_2_20_COST 1312769</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">/* Truncate the output size of scrypt to give us 32byte values we can use as a cipher key */</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor">#define SCRYPT_OUTPUT_SIZE 32</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="preprocessor">#define SCRYPT_SALT_SIZE 16</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="preprocessor">#define BCRYPT_15_COST 15</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="preprocessor">#define BCRYPT_HASH_SIZE 64</span></div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">/* Passed without the $2y$15$. It will be injected internally */</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="preprocessor">#define BCRYPT_SALT_SIZE 22</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment">/* SCRYPT Mode Definitions */</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_SCRYPT_2_17 = { KDF_SCRYPT, KDF_ID_SCRYPT_17, SCRYPT_SALT_SIZE, SCRYPT_OUTPUT_SIZE, <a class="code" href="group__wickr__kdf.html#ga5e8df13eb2cd5cc1e09f377675ddc50f">SCRYPT_2_17_COST</a> };</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_SCRYPT_2_18 = { KDF_SCRYPT, KDF_ID_SCRYPT_18, SCRYPT_SALT_SIZE, SCRYPT_OUTPUT_SIZE, SCRYPT_2_18_COST };</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_SCRYPT_2_19 = { KDF_SCRYPT, KDF_ID_SCRYPT_19, SCRYPT_SALT_SIZE, SCRYPT_OUTPUT_SIZE, SCRYPT_2_19_COST };</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_SCRYPT_2_20 = { KDF_SCRYPT, KDF_ID_SCRYPT_20, SCRYPT_SALT_SIZE, SCRYPT_OUTPUT_SIZE, SCRYPT_2_20_COST };</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="comment">/* BCRYPT Mode Definitions */</span></div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_BCRYPT_15 = { KDF_BCRYPT, KDF_ID_BCRYPT_15, BCRYPT_SALT_SIZE, BCRYPT_HASH_SIZE, BCRYPT_15_COST };</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    </div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment">/* HKDF Mode Definitions */</span></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_HKDF_SHA256 = { KDF_HMAC_SHA2, KDF_ID_HKDF_SHA256, SHA256_DIGEST_SIZE, SHA256_DIGEST_SIZE, 0 };</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_HKDF_SHA384 = { KDF_HMAC_SHA2, KDF_ID_HKDF_SHA384, SHA384_DIGEST_SIZE, SHA384_DIGEST_SIZE, 0 };</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> KDF_HKDF_SHA512 = { KDF_HMAC_SHA2, KDF_ID_HKDF_SHA512, SHA512_DIGEST_SIZE, SHA512_DIGEST_SIZE, 0 };</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="structwickr__kdf__meta.html">  135</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta</a> {</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="structwickr__kdf__meta.html#a263e1f7c77447a5a2a57c0d5d2f4ee34">  136</a></span>&#160;    <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> <a class="code" href="structwickr__kdf__meta.html#a263e1f7c77447a5a2a57c0d5d2f4ee34">algo</a>;</div><div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="structwickr__kdf__meta.html#a315c54ee4578a01266a4e7352a52d459">  137</a></span>&#160;    <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *<a class="code" href="structwickr__kdf__meta.html#a315c54ee4578a01266a4e7352a52d459">salt</a>;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="structwickr__kdf__meta.html#abf3edef445c8849c356d1282e49033f4">  138</a></span>&#160;    <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *<a class="code" href="structwickr__kdf__meta.html#abf3edef445c8849c356d1282e49033f4">info</a>;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;};</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta</a> <a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a>;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="structwickr__kdf__result.html">  155</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structwickr__kdf__result.html">wickr_kdf_result</a> {</div><div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="structwickr__kdf__result.html#a8cf0778f7cb1a157ba3f44f34cbcd92e">  156</a></span>&#160;    <a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *<a class="code" href="structwickr__kdf__result.html#a8cf0778f7cb1a157ba3f44f34cbcd92e">meta</a>;</div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="structwickr__kdf__result.html#a9b637f293f3243897f9e472b6ad06c21">  157</a></span>&#160;    <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *<a class="code" href="structwickr__kdf__result.html#a9b637f293f3243897f9e472b6ad06c21">hash</a>;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;};</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structwickr__kdf__result.html">wickr_kdf_result</a> <a class="code" href="structwickr__kdf__result.html">wickr_kdf_result_t</a>;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *<a class="code" href="group__wickr__kdf.html#gaeee99bcfbf94fd964158ac402e2deb48">wickr_kdf_meta_create</a>(<a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> algo, <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *salt, <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *info);</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;uint8_t <a class="code" href="group__wickr__kdf.html#ga92020ae3e8ffb469c927d17f95a7dff1">wickr_kdf_meta_size_with_buffer</a>(<span class="keyword">const</span> <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer);</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *<a class="code" href="group__wickr__kdf.html#ga1bc501706b4a8a727dfd34f8a00e56da">wickr_kdf_meta_serialize</a>(<span class="keyword">const</span> <a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *<a class="code" href="structwickr__kdf__result.html#a8cf0778f7cb1a157ba3f44f34cbcd92e">meta</a>);</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;<a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *<a class="code" href="group__wickr__kdf.html#gaebd1caf94717c403c4afb5cca8f511b6">wickr_kdf_meta_create_with_buffer</a>(<span class="keyword">const</span> <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer);</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *<a class="code" href="group__wickr__kdf.html#ga6ed878108fd58ee420239689de505190">wickr_kdf_meta_copy</a>(<span class="keyword">const</span> <a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *source);</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__wickr__kdf.html#ga2bd458ae83d4d5bb03b9d0835baeefd7">wickr_kdf_meta_destroy</a>(<a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> **<a class="code" href="structwickr__kdf__result.html#a8cf0778f7cb1a157ba3f44f34cbcd92e">meta</a>);</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;<a class="code" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *<a class="code" href="group__wickr__kdf.html#ga514c095b3b2f1ead49bd7fbf0b427407">wickr_kdf_result_create</a>(<a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *<a class="code" href="structwickr__kdf__result.html#a8cf0778f7cb1a157ba3f44f34cbcd92e">meta</a>, <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *<a class="code" href="structwickr__kdf__result.html#a9b637f293f3243897f9e472b6ad06c21">hash</a>);</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;<a class="code" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *<a class="code" href="group__wickr__kdf.html#ga69c03c94bf446471ba74f76ee883f8d4">wickr_kdf_result_copy</a>(<span class="keyword">const</span> <a class="code" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *source);</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__wickr__kdf.html#ga61ff0036a7257321ff0bbdc184d856a3">wickr_kdf_result_destroy</a>(<a class="code" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> **result);</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;<a class="code" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *<a class="code" href="group__wickr__kdf.html#gabc745cc1349f64c0f25d6d12de5f64cd">wickr_perform_kdf</a>(<a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> algo, <span class="keyword">const</span> <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase);</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;<a class="code" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *<a class="code" href="group__wickr__kdf.html#ga69674856e11652a18663fc7f833ad974">wickr_perform_kdf_meta</a>(<span class="keyword">const</span> <a class="code" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *existing_meta, <span class="keyword">const</span> <a class="code" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase);</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160; </div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;<span class="keyword">const</span> <a class="code" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> *<a class="code" href="group__wickr__kdf.html#ga81c7a5adea69d04e019dd58080268a08">wickr_hkdf_algo_for_digest</a>(<a class="code" href="structwickr__digest.html">wickr_digest_t</a> digest);</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;}</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* kdf_h */</span><span class="preprocessor"></span></div><div class="ttc" id="structwickr__kdf__meta_html"><div class="ttname"><a href="structwickr__kdf__meta.html">wickr_kdf_meta</a></div><div class="ttdoc">Represents the information the KDF function will need along with it's input to derive a particular ou...</div><div class="ttdef"><b>Definition:</b> kdf.h:135</div></div>
<div class="ttc" id="structwickr__kdf__result_html_a8cf0778f7cb1a157ba3f44f34cbcd92e"><div class="ttname"><a href="structwickr__kdf__result.html#a8cf0778f7cb1a157ba3f44f34cbcd92e">wickr_kdf_result::meta</a></div><div class="ttdeci">wickr_kdf_meta_t * meta</div><div class="ttdef"><b>Definition:</b> kdf.h:156</div></div>
<div class="ttc" id="structwickr__kdf__algo_html_a9a6ccf9787e16898d1724292dab6593e"><div class="ttname"><a href="structwickr__kdf__algo.html#a9a6ccf9787e16898d1724292dab6593e">wickr_kdf_algo::salt_size</a></div><div class="ttdeci">uint8_t salt_size</div><div class="ttdef"><b>Definition:</b> kdf.h:74</div></div>
<div class="ttc" id="structwickr__kdf__meta_html_a263e1f7c77447a5a2a57c0d5d2f4ee34"><div class="ttname"><a href="structwickr__kdf__meta.html#a263e1f7c77447a5a2a57c0d5d2f4ee34">wickr_kdf_meta::algo</a></div><div class="ttdeci">wickr_kdf_algo_t algo</div><div class="ttdef"><b>Definition:</b> kdf.h:136</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga514c095b3b2f1ead49bd7fbf0b427407"><div class="ttname"><a href="group__wickr__kdf.html#ga514c095b3b2f1ead49bd7fbf0b427407">wickr_kdf_result_create</a></div><div class="ttdeci">wickr_kdf_result_t * wickr_kdf_result_create(wickr_kdf_meta_t *meta, wickr_buffer_t *hash)</div></div>
<div class="ttc" id="structwickr__kdf__meta_html_a315c54ee4578a01266a4e7352a52d459"><div class="ttname"><a href="structwickr__kdf__meta.html#a315c54ee4578a01266a4e7352a52d459">wickr_kdf_meta::salt</a></div><div class="ttdeci">wickr_buffer_t * salt</div><div class="ttdef"><b>Definition:</b> kdf.h:137</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga69674856e11652a18663fc7f833ad974"><div class="ttname"><a href="group__wickr__kdf.html#ga69674856e11652a18663fc7f833ad974">wickr_perform_kdf_meta</a></div><div class="ttdeci">wickr_kdf_result_t * wickr_perform_kdf_meta(const wickr_kdf_meta_t *existing_meta, const wickr_buffer_t *passphrase)</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga106149e3507106abb6b5be843a4e7c16"><div class="ttname"><a href="group__wickr__kdf.html#ga106149e3507106abb6b5be843a4e7c16">wickr_kdf_algo_id</a></div><div class="ttdeci">wickr_kdf_algo_id</div><div class="ttdef"><b>Definition:</b> kdf.h:47</div></div>
<div class="ttc" id="structwickr__buffer_html"><div class="ttname"><a href="structwickr__buffer.html">wickr_buffer</a></div><div class="ttdoc">Represents an array of bytes and the length of the allocation associated with those bytes.</div><div class="ttdef"><b>Definition:</b> buffer.h:51</div></div>
<div class="ttc" id="structwickr__kdf__algo_html_a3591ba4f7b6b916381ad28327a67d08c"><div class="ttname"><a href="structwickr__kdf__algo.html#a3591ba4f7b6b916381ad28327a67d08c">wickr_kdf_algo::cost</a></div><div class="ttdeci">uint32_t cost</div><div class="ttdef"><b>Definition:</b> kdf.h:76</div></div>
<div class="ttc" id="structwickr__kdf__result_html"><div class="ttname"><a href="structwickr__kdf__result.html">wickr_kdf_result</a></div><div class="ttdoc">Represents the result of a KDF function execution.</div><div class="ttdef"><b>Definition:</b> kdf.h:155</div></div>
<div class="ttc" id="group__wickr__kdf_html_gaeee99bcfbf94fd964158ac402e2deb48"><div class="ttname"><a href="group__wickr__kdf.html#gaeee99bcfbf94fd964158ac402e2deb48">wickr_kdf_meta_create</a></div><div class="ttdeci">wickr_kdf_meta_t * wickr_kdf_meta_create(wickr_kdf_algo_t algo, wickr_buffer_t *salt, wickr_buffer_t *info)</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga61ff0036a7257321ff0bbdc184d856a3"><div class="ttname"><a href="group__wickr__kdf.html#ga61ff0036a7257321ff0bbdc184d856a3">wickr_kdf_result_destroy</a></div><div class="ttdeci">void wickr_kdf_result_destroy(wickr_kdf_result_t **result)</div></div>
<div class="ttc" id="structwickr__kdf__algo_html"><div class="ttname"><a href="structwickr__kdf__algo.html">wickr_kdf_algo</a></div><div class="ttdoc">Metadata associated with a particular KDF function.</div><div class="ttdef"><b>Definition:</b> kdf.h:71</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga5e8df13eb2cd5cc1e09f377675ddc50f"><div class="ttname"><a href="group__wickr__kdf.html#ga5e8df13eb2cd5cc1e09f377675ddc50f">SCRYPT_2_17_COST</a></div><div class="ttdeci">#define SCRYPT_2_17_COST</div><div class="ttdef"><b>Definition:</b> kdf.h:92</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga81c7a5adea69d04e019dd58080268a08"><div class="ttname"><a href="group__wickr__kdf.html#ga81c7a5adea69d04e019dd58080268a08">wickr_hkdf_algo_for_digest</a></div><div class="ttdeci">const wickr_kdf_algo_t * wickr_hkdf_algo_for_digest(wickr_digest_t digest)</div></div>
<div class="ttc" id="group__wickr__kdf_html_gabc745cc1349f64c0f25d6d12de5f64cd"><div class="ttname"><a href="group__wickr__kdf.html#gabc745cc1349f64c0f25d6d12de5f64cd">wickr_perform_kdf</a></div><div class="ttdeci">wickr_kdf_result_t * wickr_perform_kdf(wickr_kdf_algo_t algo, const wickr_buffer_t *passphrase)</div></div>
<div class="ttc" id="structwickr__kdf__algo_html_a75e5396b3c53817c6799dbf3107e36d6"><div class="ttname"><a href="structwickr__kdf__algo.html#a75e5396b3c53817c6799dbf3107e36d6">wickr_kdf_algo::output_size</a></div><div class="ttdeci">uint8_t output_size</div><div class="ttdef"><b>Definition:</b> kdf.h:75</div></div>
<div class="ttc" id="group__wickr__kdf_html_gaebd1caf94717c403c4afb5cca8f511b6"><div class="ttname"><a href="group__wickr__kdf.html#gaebd1caf94717c403c4afb5cca8f511b6">wickr_kdf_meta_create_with_buffer</a></div><div class="ttdeci">wickr_kdf_meta_t * wickr_kdf_meta_create_with_buffer(const wickr_buffer_t *buffer)</div></div>
<div class="ttc" id="structwickr__kdf__algo_html_a0cf9976901115634ddbb6193b6e326ba"><div class="ttname"><a href="structwickr__kdf__algo.html#a0cf9976901115634ddbb6193b6e326ba">wickr_kdf_algo::kdf_id</a></div><div class="ttdeci">wickr_kdf_id kdf_id</div><div class="ttdef"><b>Definition:</b> kdf.h:73</div></div>
<div class="ttc" id="structwickr__kdf__algo_html_a1bc420e2ca0f36169e261205bf6246e9"><div class="ttname"><a href="structwickr__kdf__algo.html#a1bc420e2ca0f36169e261205bf6246e9">wickr_kdf_algo::algo_id</a></div><div class="ttdeci">wickr_kdf_algo_id algo_id</div><div class="ttdef"><b>Definition:</b> kdf.h:72</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga69c03c94bf446471ba74f76ee883f8d4"><div class="ttname"><a href="group__wickr__kdf.html#ga69c03c94bf446471ba74f76ee883f8d4">wickr_kdf_result_copy</a></div><div class="ttdeci">wickr_kdf_result_t * wickr_kdf_result_copy(const wickr_kdf_result_t *source)</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga2bd458ae83d4d5bb03b9d0835baeefd7"><div class="ttname"><a href="group__wickr__kdf.html#ga2bd458ae83d4d5bb03b9d0835baeefd7">wickr_kdf_meta_destroy</a></div><div class="ttdeci">void wickr_kdf_meta_destroy(wickr_kdf_meta_t **meta)</div></div>
<div class="ttc" id="structwickr__kdf__meta_html_abf3edef445c8849c356d1282e49033f4"><div class="ttname"><a href="structwickr__kdf__meta.html#abf3edef445c8849c356d1282e49033f4">wickr_kdf_meta::info</a></div><div class="ttdeci">wickr_buffer_t * info</div><div class="ttdef"><b>Definition:</b> kdf.h:138</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga6ed878108fd58ee420239689de505190"><div class="ttname"><a href="group__wickr__kdf.html#ga6ed878108fd58ee420239689de505190">wickr_kdf_meta_copy</a></div><div class="ttdeci">wickr_kdf_meta_t * wickr_kdf_meta_copy(const wickr_kdf_meta_t *source)</div></div>
<div class="ttc" id="structwickr__digest_html"><div class="ttname"><a href="structwickr__digest.html">wickr_digest</a></div><div class="ttdoc">Digest function parameters.</div><div class="ttdef"><b>Definition:</b> digest.h:54</div></div>
<div class="ttc" id="structwickr__kdf__result_html_a9b637f293f3243897f9e472b6ad06c21"><div class="ttname"><a href="structwickr__kdf__result.html#a9b637f293f3243897f9e472b6ad06c21">wickr_kdf_result::hash</a></div><div class="ttdeci">wickr_buffer_t * hash</div><div class="ttdef"><b>Definition:</b> kdf.h:157</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga1bc501706b4a8a727dfd34f8a00e56da"><div class="ttname"><a href="group__wickr__kdf.html#ga1bc501706b4a8a727dfd34f8a00e56da">wickr_kdf_meta_serialize</a></div><div class="ttdeci">wickr_buffer_t * wickr_kdf_meta_serialize(const wickr_kdf_meta_t *meta)</div></div>
<div class="ttc" id="group__wickr__kdf_html_ga92020ae3e8ffb469c927d17f95a7dff1"><div class="ttname"><a href="group__wickr__kdf.html#ga92020ae3e8ffb469c927d17f95a7dff1">wickr_kdf_meta_size_with_buffer</a></div><div class="ttdeci">uint8_t wickr_kdf_meta_size_with_buffer(const wickr_buffer_t *buffer)</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
